﻿using Cocos2D;

namespace TestTiger.PlayingCard
{
    public class PokerCard:CCSprite
    {
        /// <summary>
        /// Cards数字
        /// A==1 .....K==13
        /// </summary>
        public int CardNumber{ get; private set; }
        /// <summary>
        /// 扑克牌花色
        /// </summary>
        public CardColor  Color { get; private set; }
        /// <summary>
        /// 13 = A+方片
        /// </summary>
        public int CardID { get; private set; }
        public bool IsVisble { get; set; }

        public int Height
        {
            get { return Texture != null ? this.Texture.PixelsHigh : 0; }
        }
        public int Width
        {
            get { return Texture != null ? Texture.PixelsWide : 0; }
        }

        /// <summary>
        /// 扑克牌
        /// </summary>
        /// <param name="texture2D">图片</param>
        /// <param name="pt">坐标</param>
        /// <param name="cardId">牌号</param>
        /// <param name="visble">是否显示</param>
        public PokerCard(string texturename, CCPoint pt, int cardnumber, CardColor color, bool visble)
            : base(texturename)
        {
            Position = pt;
            CardNumber = cardnumber;
            Color = color;
            //红桃3 =  32
            CardID = cardnumber + 10 + (int) color;
            IsVisble = visble;           
        }
    }
}